/*
 * FinishedGameScreen.java
 *
 * Created on May 17, 2007, 6:42 PM
 *
 * Copyright (c) 2007 Daniel Gronau
 *
 * This file is part of KanjiTori.
 *
 * KanjiTori is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * KanjiTori is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

package kanjitori.gamestate.screen;

import com.jme.input.InputHandler;
import com.jme.scene.Node;
import com.jme.system.DisplaySystem;
/*import com.jmex.bui.BContainer;
import com.jmex.bui.BDecoratedWindow;
import com.jmex.bui.BLabel;
import com.jmex.bui.BStyleSheet;
import com.jmex.bui.BWindow;
import com.jmex.bui.PolledRootNode;
import com.jmex.bui.layout.GroupLayout;*/
import java.io.InputStream;
import java.io.InputStreamReader;
import kanjitori.stats.Statistics;
import com.jme.util.Timer; 

//import static com.jmex.bui.BConstants.*;
import java.util.ResourceBundle;

/**
 *
 * @author DGronau
 */
public class FinishedGameScreen {
    
    private ResourceBundle bundle = ResourceBundle.getBundle("kanjitori/resources/String");
    
    private InputHandler input = new InputHandler();
    private Timer timer = Timer.getTimer(); 
    
    /** Creates a new instance of FinishedGameScreen 
     * @param stats 
     * @param rootNode 
     */
    public FinishedGameScreen(Statistics stats, Node rootNode) {
        
        /*PolledRootNode root = new PolledRootNode(timer, input);
        rootNode.attachChild(root); 
        
        BStyleSheet style = null;
        try {
            InputStream stin = getClass().getClassLoader().
                    getResourceAsStream("kanjitori/res/bui/kanjitori.bss");
            style = new BStyleSheet(new InputStreamReader(stin),
                    new BStyleSheet.DefaultResourceProvider());
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
        BWindow window = new BDecoratedWindow(style, null);
        window.setLayoutManager(GroupLayout.makeVStretch());*/
        
        /*BImage image = null;
        try {
            image = new BImage(getClass().getClassLoader().
                    getResource("rsrc/textures/scroll_right.png"));
        } catch (Exception e) {
            e.printStackTrace(System.err);
        }
        ImageIcon icon = new ImageIcon(image);
        String[] aligns = { "left", "center", "right" };
        int[] orients = { HORIZONTAL, VERTICAL, OVERLAPPING };*/
        
        /*
        BLabel label = new BLabel(bundle.getString("Stats_" + stats.getResult().toString()), "center");
        window.add(label);
        
        BContainer cont = new BContainer(GroupLayout.makeHStretch());
        window.add(cont);
        label = new BLabel(bundle.getString("Stats_questions_total") + "   ", "right");
        cont.add(label);
        label = new BLabel("   " + stats.getQuestionsTotal(), "left");
        cont.add(label);
        
        cont = new BContainer(GroupLayout.makeHStretch());
        window.add(cont);
        label = new BLabel(bundle.getString("Stats_questions_right") + "   ", "right");
        cont.add(label);
        label = new BLabel("   " + stats.getQuestionsRight(), "left");
        cont.add(label);

        cont = new BContainer(GroupLayout.makeHStretch());
        window.add(cont);
        label = new BLabel(bundle.getString("Stats_bots_total") + "   ", "right");
        cont.add(label);
        label = new BLabel("   " + stats.getBotsTotal(), "left");
        cont.add(label);

        cont = new BContainer(GroupLayout.makeHStretch());
        window.add(cont);
        label = new BLabel(bundle.getString("Stats_bots_right") + "   ", "right");
        cont.add(label);
        label = new BLabel("   " + stats.getBotsRight(), "left");
        cont.add(label);
        
        cont = new BContainer(GroupLayout.makeHStretch());
        window.add(cont);
        label = new BLabel(bundle.getString("Stats_hurt") + "   ", "right");
        cont.add(label);
        label = new BLabel("   " + stats.getHurt(), "left");
        cont.add(label);
        
        cont = new BContainer(GroupLayout.makeHStretch());
        window.add(cont);
        label = new BLabel(bundle.getString("Stats_time") + "   ", "right");
        cont.add(label);
        label = new BLabel(String.format("   %02d:%02d", stats.getSeconds() / 60, stats.getSeconds() % 60), "left");
        cont.add(label);
        
        
        root.addWindow(window);
        window.setSize(500, 300);
        window.setLocation((DisplaySystem.getDisplaySystem().getWidth() - 500)/2, 
                           (DisplaySystem.getDisplaySystem().getHeight() - 300)/2);*/
    }
    
    
}
